

import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import path, { resolve } from "path";
import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite";
import { AntDesignVueResolver } from "unplugin-vue-components/resolvers";
export default defineConfig({
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "src"),
    },
  },
  plugins: [
    vue(),
    AutoImport({
      imports: ["vue", "vue-router"],
      dts: "src/auto-import.d.ts",
      resolvers: [AntDesignVueResolver()],
    }),
    Components({
      resolvers: [
        AntDesignVueResolver({ importStyle: true, resolveIcons: true }),
      ],
    }),
  ],
  server: {
    port: 8089,
    host: "0.0.0.0",
    proxy: {
      // 后端请求路径
      "^/gaoqing": {
        target: "http://127.0.0.1:8202/",
        changeOrigin: true, 
      },
    },
  },

});
